<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - iris.info - /usr/include/pthread.h</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">usr/include</a> - pthread.h</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>iris.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-05-24</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">9</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">0.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">0</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : /* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
<span class="lineNum">       2 </span>                :    Free Software Foundation, Inc.
<span class="lineNum">       3 </span>                :    This file is part of the GNU C Library.
<span class="lineNum">       4 </span>                : 
<span class="lineNum">       5 </span>                :    The GNU C Library is free software; you can redistribute it and/or
<span class="lineNum">       6 </span>                :    modify it under the terms of the GNU Lesser General Public
<span class="lineNum">       7 </span>                :    License as published by the Free Software Foundation; either
<span class="lineNum">       8 </span>                :    version 2.1 of the License, or (at your option) any later version.
<span class="lineNum">       9 </span>                : 
<span class="lineNum">      10 </span>                :    The GNU C Library is distributed in the hope that it will be useful,
<span class="lineNum">      11 </span>                :    but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      12 </span>                :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
<span class="lineNum">      13 </span>                :    Lesser General Public License for more details.
<span class="lineNum">      14 </span>                : 
<span class="lineNum">      15 </span>                :    You should have received a copy of the GNU Lesser General Public
<span class="lineNum">      16 </span>                :    License along with the GNU C Library; if not, write to the Free
<span class="lineNum">      17 </span>                :    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
<span class="lineNum">      18 </span>                :    02111-1307 USA.  */
<span class="lineNum">      19 </span>                : 
<span class="lineNum">      20 </span>                : #ifndef _PTHREAD_H
<span class="lineNum">      21 </span>                : #define _PTHREAD_H      1
<span class="lineNum">      22 </span>                : 
<span class="lineNum">      23 </span>                : #include &lt;features.h&gt;
<span class="lineNum">      24 </span>                : #include &lt;endian.h&gt;
<span class="lineNum">      25 </span>                : #include &lt;sched.h&gt;
<span class="lineNum">      26 </span>                : #include &lt;time.h&gt;
<span class="lineNum">      27 </span>                : 
<span class="lineNum">      28 </span>                : #define __need_sigset_t
<span class="lineNum">      29 </span>                : #include &lt;signal.h&gt;
<span class="lineNum">      30 </span>                : #include &lt;bits/pthreadtypes.h&gt;
<span class="lineNum">      31 </span>                : #include &lt;bits/setjmp.h&gt;
<span class="lineNum">      32 </span>                : #include &lt;bits/wordsize.h&gt;
<span class="lineNum">      33 </span>                : 
<span class="lineNum">      34 </span>                : 
<span class="lineNum">      35 </span>                : /* Detach state.  */
<span class="lineNum">      36 </span>                : enum
<span class="lineNum">      37 </span>                : {
<span class="lineNum">      38 </span>                :   PTHREAD_CREATE_JOINABLE,
<span class="lineNum">      39 </span>                : #define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
<span class="lineNum">      40 </span>                :   PTHREAD_CREATE_DETACHED
<span class="lineNum">      41 </span>                : #define PTHREAD_CREATE_DETACHED PTHREAD_CREATE_DETACHED
<span class="lineNum">      42 </span>                : };
<span class="lineNum">      43 </span>                : 
<span class="lineNum">      44 </span>                : 
<span class="lineNum">      45 </span>                : /* Mutex types.  */
<span class="lineNum">      46 </span>                : enum
<span class="lineNum">      47 </span>                : {
<span class="lineNum">      48 </span>                :   PTHREAD_MUTEX_TIMED_NP,
<span class="lineNum">      49 </span>                :   PTHREAD_MUTEX_RECURSIVE_NP,
<span class="lineNum">      50 </span>                :   PTHREAD_MUTEX_ERRORCHECK_NP,
<span class="lineNum">      51 </span>                :   PTHREAD_MUTEX_ADAPTIVE_NP
<span class="lineNum">      52 </span>                : #ifdef __USE_UNIX98
<span class="lineNum">      53 </span>                :   ,
<span class="lineNum">      54 </span>                :   PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
<span class="lineNum">      55 </span>                :   PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
<span class="lineNum">      56 </span>                :   PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
<span class="lineNum">      57 </span>                :   PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
<span class="lineNum">      58 </span>                : #endif
<span class="lineNum">      59 </span>                : #ifdef __USE_GNU
<span class="lineNum">      60 </span>                :   /* For compatibility.  */
<span class="lineNum">      61 </span>                :   , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
<span class="lineNum">      62 </span>                : #endif
<span class="lineNum">      63 </span>                : };
<span class="lineNum">      64 </span>                : 
<span class="lineNum">      65 </span>                : 
<span class="lineNum">      66 </span>                : #ifdef __USE_GNU
<span class="lineNum">      67 </span>                : /* Robust mutex or not flags.  */
<span class="lineNum">      68 </span>                : enum
<span class="lineNum">      69 </span>                : {
<span class="lineNum">      70 </span>                :   PTHREAD_MUTEX_STALLED_NP,
<span class="lineNum">      71 </span>                :   PTHREAD_MUTEX_ROBUST_NP
<span class="lineNum">      72 </span>                : };
<span class="lineNum">      73 </span>                : #endif
<span class="lineNum">      74 </span>                : 
<span class="lineNum">      75 </span>                : 
<span class="lineNum">      76 </span>                : #ifdef __USE_UNIX98
<span class="lineNum">      77 </span>                : /* Mutex protocols.  */
<span class="lineNum">      78 </span>                : enum
<span class="lineNum">      79 </span>                : {
<span class="lineNum">      80 </span>                :   PTHREAD_PRIO_NONE,
<span class="lineNum">      81 </span>                :   PTHREAD_PRIO_INHERIT,
<span class="lineNum">      82 </span>                :   PTHREAD_PRIO_PROTECT
<span class="lineNum">      83 </span>                : };
<span class="lineNum">      84 </span>                : #endif
<span class="lineNum">      85 </span>                : 
<span class="lineNum">      86 </span>                : 
<span class="lineNum">      87 </span>                : /* Mutex initializers.  */
<span class="lineNum">      88 </span>                : #if __WORDSIZE == 64
<span class="lineNum">      89 </span>                : # define PTHREAD_MUTEX_INITIALIZER \
<span class="lineNum">      90 </span>                :   { { 0, 0, 0, 0, 0, 0, { 0, 0 } } }
<span class="lineNum">      91 </span>                : # ifdef __USE_GNU
<span class="lineNum">      92 </span>                : #  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
<span class="lineNum">      93 </span>                :   { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0, 0 } } }
<span class="lineNum">      94 </span>                : #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
<span class="lineNum">      95 </span>                :   { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0, 0 } } }
<span class="lineNum">      96 </span>                : #  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
<span class="lineNum">      97 </span>                :   { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0, 0 } } }
<span class="lineNum">      98 </span>                : # endif
<span class="lineNum">      99 </span>                : #else
<span class="lineNum">     100 </span>                : # define PTHREAD_MUTEX_INITIALIZER \
<span class="lineNum">     101 </span>                :   { { 0, 0, 0, 0, 0, { 0 } } }
<span class="lineNum">     102 </span>                : # ifdef __USE_GNU
<span class="lineNum">     103 </span>                : #  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
<span class="lineNum">     104 </span>                :   { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }
<span class="lineNum">     105 </span>                : #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
<span class="lineNum">     106 </span>                :   { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } }
<span class="lineNum">     107 </span>                : #  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
<span class="lineNum">     108 </span>                :   { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } }
<span class="lineNum">     109 </span>                : # endif
<span class="lineNum">     110 </span>                : #endif
<span class="lineNum">     111 </span>                : 
<span class="lineNum">     112 </span>                : 
<span class="lineNum">     113 </span>                : /* Read-write lock types.  */
<span class="lineNum">     114 </span>                : #if defined __USE_UNIX98 || defined __USE_XOPEN2K
<span class="lineNum">     115 </span>                : enum
<span class="lineNum">     116 </span>                : {
<span class="lineNum">     117 </span>                :   PTHREAD_RWLOCK_PREFER_READER_NP,
<span class="lineNum">     118 </span>                :   PTHREAD_RWLOCK_PREFER_WRITER_NP,
<span class="lineNum">     119 </span>                :   PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
<span class="lineNum">     120 </span>                :   PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
<span class="lineNum">     121 </span>                : };
<span class="lineNum">     122 </span>                : 
<span class="lineNum">     123 </span>                : /* Read-write lock initializers.  */
<span class="lineNum">     124 </span>                : # define PTHREAD_RWLOCK_INITIALIZER \
<span class="lineNum">     125 </span>                :   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
<span class="lineNum">     126 </span>                : # ifdef __USE_GNU
<span class="lineNum">     127 </span>                : #  if __WORDSIZE == 64
<span class="lineNum">     128 </span>                : #   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
<span class="lineNum">     129 </span>                :   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,                                           \
<span class="lineNum">     130 </span>                :         PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
<span class="lineNum">     131 </span>                : #  else
<span class="lineNum">     132 </span>                : #   if __BYTE_ORDER == __LITTLE_ENDIAN
<span class="lineNum">     133 </span>                : #    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
<span class="lineNum">     134 </span>                :   { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
<span class="lineNum">     135 </span>                :       0, 0, 0, 0 } }
<span class="lineNum">     136 </span>                : #   else
<span class="lineNum">     137 </span>                : #    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
<span class="lineNum">     138 </span>                :   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
<span class="lineNum">     139 </span>                :       0 } }
<span class="lineNum">     140 </span>                : #   endif
<span class="lineNum">     141 </span>                : #  endif
<span class="lineNum">     142 </span>                : # endif
<span class="lineNum">     143 </span>                : #endif  /* Unix98 or XOpen2K */
<span class="lineNum">     144 </span>                : 
<span class="lineNum">     145 </span>                : 
<span class="lineNum">     146 </span>                : /* Scheduler inheritance.  */
<span class="lineNum">     147 </span>                : enum
<span class="lineNum">     148 </span>                : {
<span class="lineNum">     149 </span>                :   PTHREAD_INHERIT_SCHED,
<span class="lineNum">     150 </span>                : #define PTHREAD_INHERIT_SCHED   PTHREAD_INHERIT_SCHED
<span class="lineNum">     151 </span>                :   PTHREAD_EXPLICIT_SCHED
<span class="lineNum">     152 </span>                : #define PTHREAD_EXPLICIT_SCHED  PTHREAD_EXPLICIT_SCHED
<span class="lineNum">     153 </span>                : };
<span class="lineNum">     154 </span>                : 
<span class="lineNum">     155 </span>                : 
<span class="lineNum">     156 </span>                : /* Scope handling.  */
<span class="lineNum">     157 </span>                : enum
<span class="lineNum">     158 </span>                : {
<span class="lineNum">     159 </span>                :   PTHREAD_SCOPE_SYSTEM,
<span class="lineNum">     160 </span>                : #define PTHREAD_SCOPE_SYSTEM    PTHREAD_SCOPE_SYSTEM
<span class="lineNum">     161 </span>                :   PTHREAD_SCOPE_PROCESS
<span class="lineNum">     162 </span>                : #define PTHREAD_SCOPE_PROCESS   PTHREAD_SCOPE_PROCESS
<span class="lineNum">     163 </span>                : };
<span class="lineNum">     164 </span>                : 
<span class="lineNum">     165 </span>                : 
<span class="lineNum">     166 </span>                : /* Process shared or private flag.  */
<span class="lineNum">     167 </span>                : enum
<span class="lineNum">     168 </span>                : {
<span class="lineNum">     169 </span>                :   PTHREAD_PROCESS_PRIVATE,
<span class="lineNum">     170 </span>                : #define PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE
<span class="lineNum">     171 </span>                :   PTHREAD_PROCESS_SHARED
<span class="lineNum">     172 </span>                : #define PTHREAD_PROCESS_SHARED  PTHREAD_PROCESS_SHARED
<span class="lineNum">     173 </span>                : };
<span class="lineNum">     174 </span>                : 
<span class="lineNum">     175 </span>                : 
<span class="lineNum">     176 </span>                : 
<span class="lineNum">     177 </span>                : /* Conditional variable handling.  */
<span class="lineNum">     178 </span>                : #define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
<span class="lineNum">     179 </span>                : 
<span class="lineNum">     180 </span>                : 
<span class="lineNum">     181 </span>                : /* Cleanup buffers */
<span class="lineNum">     182 </span>                : struct _pthread_cleanup_buffer
<span class="lineNum">     183 </span>                : {
<span class="lineNum">     184 </span>                :   void (*__routine) (void *);             /* Function to call.  */
<span class="lineNum">     185 </span>                :   void *__arg;                            /* Its argument.  */
<span class="lineNum">     186 </span>                :   int __canceltype;                       /* Saved cancellation type. */
<span class="lineNum">     187 </span>                :   struct _pthread_cleanup_buffer *__prev; /* Chaining of cleanup functions.  */
<span class="lineNum">     188 </span>                : };
<span class="lineNum">     189 </span>                : 
<span class="lineNum">     190 </span>                : /* Cancellation */
<span class="lineNum">     191 </span>                : enum
<span class="lineNum">     192 </span>                : {
<span class="lineNum">     193 </span>                :   PTHREAD_CANCEL_ENABLE,
<span class="lineNum">     194 </span>                : #define PTHREAD_CANCEL_ENABLE   PTHREAD_CANCEL_ENABLE
<span class="lineNum">     195 </span>                :   PTHREAD_CANCEL_DISABLE
<span class="lineNum">     196 </span>                : #define PTHREAD_CANCEL_DISABLE  PTHREAD_CANCEL_DISABLE
<span class="lineNum">     197 </span>                : };
<span class="lineNum">     198 </span>                : enum
<span class="lineNum">     199 </span>                : {
<span class="lineNum">     200 </span>                :   PTHREAD_CANCEL_DEFERRED,
<span class="lineNum">     201 </span>                : #define PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED
<span class="lineNum">     202 </span>                :   PTHREAD_CANCEL_ASYNCHRONOUS
<span class="lineNum">     203 </span>                : #define PTHREAD_CANCEL_ASYNCHRONOUS     PTHREAD_CANCEL_ASYNCHRONOUS
<span class="lineNum">     204 </span>                : };
<span class="lineNum">     205 </span>                : #define PTHREAD_CANCELED ((void *) -1)
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span>                : 
<span class="lineNum">     208 </span>                : /* Single execution handling.  */
<span class="lineNum">     209 </span>                : #define PTHREAD_ONCE_INIT 0
<span class="lineNum">     210 </span>                : 
<span class="lineNum">     211 </span>                : 
<span class="lineNum">     212 </span>                : #ifdef __USE_XOPEN2K
<span class="lineNum">     213 </span>                : /* Value returned by 'pthread_barrier_wait' for one of the threads after
<span class="lineNum">     214 </span>                :    the required number of threads have called this function.
<span class="lineNum">     215 </span>                :    -1 is distinct from 0 and all errno constants */
<span class="lineNum">     216 </span>                : # define PTHREAD_BARRIER_SERIAL_THREAD -1
<span class="lineNum">     217 </span>                : #endif
<span class="lineNum">     218 </span>                : 
<span class="lineNum">     219 </span>                : 
<span class="lineNum">     220 </span>                : __BEGIN_DECLS
<span class="lineNum">     221 </span>                : 
<span class="lineNum">     222 </span>                : /* Create a new thread, starting with execution of START-ROUTINE
<span class="lineNum">     223 </span>                :    getting passed ARG.  Creation attributed come from ATTR.  The new
<span class="lineNum">     224 </span>                :    handle is stored in *NEWTHREAD.  */
<span class="lineNum">     225 </span>                : extern int pthread_create (pthread_t *__restrict __newthread,
<span class="lineNum">     226 </span>                :                            __const pthread_attr_t *__restrict __attr,
<span class="lineNum">     227 </span>                :                            void *(*__start_routine) (void *),
<span class="lineNum">     228 </span>                :                            void *__restrict __arg) __THROW __nonnull ((1, 3));
<span class="lineNum">     229 </span>                : 
<span class="lineNum">     230 </span>                : /* Terminate calling thread.
<span class="lineNum">     231 </span>                : 
<span class="lineNum">     232 </span>                :    The registered cleanup handlers are called via exception handling
<span class="lineNum">     233 </span>                :    so we cannot mark this function with __THROW.*/
<span class="lineNum">     234 </span>                : extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
<span class="lineNum">     235 </span>                : 
<span class="lineNum">     236 </span>                : /* Make calling thread wait for termination of the thread TH.  The
<span class="lineNum">     237 </span>                :    exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
<span class="lineNum">     238 </span>                :    is not NULL.
<span class="lineNum">     239 </span>                : 
<span class="lineNum">     240 </span>                :    This function is a cancellation point and therefore not marked with
<span class="lineNum">     241 </span>                :    __THROW.  */
<span class="lineNum">     242 </span>                : extern int pthread_join (pthread_t __th, void **__thread_return);
<span class="lineNum">     243 </span>                : 
<span class="lineNum">     244 </span>                : #ifdef __USE_GNU
<span class="lineNum">     245 </span>                : /* Check whether thread TH has terminated.  If yes return the status of
<span class="lineNum">     246 </span>                :    the thread in *THREAD_RETURN, if THREAD_RETURN is not NULL.  */
<span class="lineNum">     247 </span>                : extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
<span class="lineNum">     248 </span>                : 
<span class="lineNum">     249 </span>                : /* Make calling thread wait for termination of the thread TH, but only
<span class="lineNum">     250 </span>                :    until TIMEOUT.  The exit status of the thread is stored in
<span class="lineNum">     251 </span>                :    *THREAD_RETURN, if THREAD_RETURN is not NULL.
<span class="lineNum">     252 </span>                : 
<span class="lineNum">     253 </span>                :    This function is a cancellation point and therefore not marked with
<span class="lineNum">     254 </span>                :    __THROW.  */
<span class="lineNum">     255 </span>                : extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
<span class="lineNum">     256 </span>                :                                  __const struct timespec *__abstime);
<span class="lineNum">     257 </span>                : #endif
<span class="lineNum">     258 </span>                : 
<span class="lineNum">     259 </span>                : /* Indicate that the thread TH is never to be joined with PTHREAD_JOIN.
<span class="lineNum">     260 </span>                :    The resources of TH will therefore be freed immediately when it
<span class="lineNum">     261 </span>                :    terminates, instead of waiting for another thread to perform PTHREAD_JOIN
<span class="lineNum">     262 </span>                :    on it.  */
<span class="lineNum">     263 </span>                : extern int pthread_detach (pthread_t __th) __THROW;
<span class="lineNum">     264 </span>                : 
<span class="lineNum">     265 </span>                : 
<span class="lineNum">     266 </span>                : /* Obtain the identifier of the current thread.  */
<span class="lineNum">     267 </span>                : extern pthread_t pthread_self (void) __THROW __attribute__ ((__const__));
<span class="lineNum">     268 </span>                : 
<span class="lineNum">     269 </span>                : /* Compare two thread identifiers.  */
<span class="lineNum">     270 </span>                : extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __THROW;
<span class="lineNum">     271 </span>                : 
<span class="lineNum">     272 </span>                : 
<span class="lineNum">     273 </span>                : /* Thread attribute handling.  */
<span class="lineNum">     274 </span>                : 
<span class="lineNum">     275 </span>                : /* Initialize thread attribute *ATTR with default attributes
<span class="lineNum">     276 </span>                :    (detachstate is PTHREAD_JOINABLE, scheduling policy is SCHED_OTHER,
<span class="lineNum">     277 </span>                :     no user-provided stack).  */
<span class="lineNum">     278 </span>                : extern int pthread_attr_init (pthread_attr_t *__attr) __THROW __nonnull ((1));
<span class="lineNum">     279 </span>                : 
<span class="lineNum">     280 </span>                : /* Destroy thread attribute *ATTR.  */
<span class="lineNum">     281 </span>                : extern int pthread_attr_destroy (pthread_attr_t *__attr)
<span class="lineNum">     282 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     283 </span>                : 
<span class="lineNum">     284 </span>                : /* Get detach state attribute.  */
<span class="lineNum">     285 </span>                : extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
<span class="lineNum">     286 </span>                :                                         int *__detachstate)
<span class="lineNum">     287 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                : /* Set detach state attribute.  */
<span class="lineNum">     290 </span>                : extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
<span class="lineNum">     291 </span>                :                                         int __detachstate)
<span class="lineNum">     292 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     293 </span>                : 
<span class="lineNum">     294 </span>                : 
<span class="lineNum">     295 </span>                : /* Get the size of the guard area created for stack overflow protection.  */
<span class="lineNum">     296 </span>                : extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
<span class="lineNum">     297 </span>                :                                       size_t *__guardsize)
<span class="lineNum">     298 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     299 </span>                : 
<span class="lineNum">     300 </span>                : /* Set the size of the guard area created for stack overflow protection.  */
<span class="lineNum">     301 </span>                : extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
<span class="lineNum">     302 </span>                :                                       size_t __guardsize)
<span class="lineNum">     303 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     304 </span>                : 
<span class="lineNum">     305 </span>                : 
<span class="lineNum">     306 </span>                : /* Return in *PARAM the scheduling parameters of *ATTR.  */
<span class="lineNum">     307 </span>                : extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
<span class="lineNum">     308 </span>                :                                        __attr,
<span class="lineNum">     309 </span>                :                                        struct sched_param *__restrict __param)
<span class="lineNum">     310 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     311 </span>                : 
<span class="lineNum">     312 </span>                : /* Set scheduling parameters (priority, etc) in *ATTR according to PARAM.  */
<span class="lineNum">     313 </span>                : extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
<span class="lineNum">     314 </span>                :                                        __const struct sched_param *__restrict
<span class="lineNum">     315 </span>                :                                        __param) __THROW __nonnull ((1, 2));
<span class="lineNum">     316 </span>                : 
<span class="lineNum">     317 </span>                : /* Return in *POLICY the scheduling policy of *ATTR.  */
<span class="lineNum">     318 </span>                : extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
<span class="lineNum">     319 </span>                :                                         __attr, int *__restrict __policy)
<span class="lineNum">     320 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     321 </span>                : 
<span class="lineNum">     322 </span>                : /* Set scheduling policy in *ATTR according to POLICY.  */
<span class="lineNum">     323 </span>                : extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
<span class="lineNum">     324 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     325 </span>                : 
<span class="lineNum">     326 </span>                : /* Return in *INHERIT the scheduling inheritance mode of *ATTR.  */
<span class="lineNum">     327 </span>                : extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
<span class="lineNum">     328 </span>                :                                          __attr, int *__restrict __inherit)
<span class="lineNum">     329 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     330 </span>                : 
<span class="lineNum">     331 </span>                : /* Set scheduling inheritance mode in *ATTR according to INHERIT.  */
<span class="lineNum">     332 </span>                : extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
<span class="lineNum">     333 </span>                :                                          int __inherit)
<span class="lineNum">     334 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     335 </span>                : 
<span class="lineNum">     336 </span>                : 
<span class="lineNum">     337 </span>                : /* Return in *SCOPE the scheduling contention scope of *ATTR.  */
<span class="lineNum">     338 </span>                : extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
<span class="lineNum">     339 </span>                :                                   int *__restrict __scope)
<span class="lineNum">     340 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     341 </span>                : 
<span class="lineNum">     342 </span>                : /* Set scheduling contention scope in *ATTR according to SCOPE.  */
<span class="lineNum">     343 </span>                : extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
<span class="lineNum">     344 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     345 </span>                : 
<span class="lineNum">     346 </span>                : /* Return the previously set address for the stack.  */
<span class="lineNum">     347 </span>                : extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
<span class="lineNum">     348 </span>                :                                       __attr, void **__restrict __stackaddr)
<span class="lineNum">     349 </span>                :      __THROW __nonnull ((1, 2)) __attribute_deprecated__;
<span class="lineNum">     350 </span>                : 
<span class="lineNum">     351 </span>                : /* Set the starting address of the stack of the thread to be created.
<span class="lineNum">     352 </span>                :    Depending on whether the stack grows up or down the value must either
<span class="lineNum">     353 </span>                :    be higher or lower than all the address in the memory block.  The
<span class="lineNum">     354 </span>                :    minimal size of the block must be PTHREAD_STACK_MIN.  */
<span class="lineNum">     355 </span>                : extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
<span class="lineNum">     356 </span>                :                                       void *__stackaddr)
<span class="lineNum">     357 </span>                :      __THROW __nonnull ((1)) __attribute_deprecated__;
<span class="lineNum">     358 </span>                : 
<span class="lineNum">     359 </span>                : /* Return the currently used minimal stack size.  */
<span class="lineNum">     360 </span>                : extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
<span class="lineNum">     361 </span>                :                                       __attr, size_t *__restrict __stacksize)
<span class="lineNum">     362 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     363 </span>                : 
<span class="lineNum">     364 </span>                : /* Add information about the minimum stack size needed for the thread
<span class="lineNum">     365 </span>                :    to be started.  This size must never be less than PTHREAD_STACK_MIN
<span class="lineNum">     366 </span>                :    and must also not exceed the system limits.  */
<span class="lineNum">     367 </span>                : extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
<span class="lineNum">     368 </span>                :                                       size_t __stacksize)
<span class="lineNum">     369 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     370 </span>                : 
<span class="lineNum">     371 </span>                : #ifdef __USE_XOPEN2K
<span class="lineNum">     372 </span>                : /* Return the previously set address for the stack.  */
<span class="lineNum">     373 </span>                : extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
<span class="lineNum">     374 </span>                :                                   void **__restrict __stackaddr,
<span class="lineNum">     375 </span>                :                                   size_t *__restrict __stacksize)
<span class="lineNum">     376 </span>                :      __THROW __nonnull ((1, 2, 3));
<span class="lineNum">     377 </span>                : 
<span class="lineNum">     378 </span>                : /* The following two interfaces are intended to replace the last two.  They
<span class="lineNum">     379 </span>                :    require setting the address as well as the size since only setting the
<span class="lineNum">     380 </span>                :    address will make the implementation on some architectures impossible.  */
<span class="lineNum">     381 </span>                : extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
<span class="lineNum">     382 </span>                :                                   size_t __stacksize) __THROW __nonnull ((1));
<span class="lineNum">     383 </span>                : #endif
<span class="lineNum">     384 </span>                : 
<span class="lineNum">     385 </span>                : #ifdef __USE_GNU
<span class="lineNum">     386 </span>                : /* Thread created with attribute ATTR will be limited to run only on
<span class="lineNum">     387 </span>                :    the processors represented in CPUSET.  */
<span class="lineNum">     388 </span>                : extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
<span class="lineNum">     389 </span>                :                                         size_t __cpusetsize,
<span class="lineNum">     390 </span>                :                                         __const cpu_set_t *__cpuset)
<span class="lineNum">     391 </span>                :      __THROW __nonnull ((1, 3));
<span class="lineNum">     392 </span>                : 
<span class="lineNum">     393 </span>                : /* Get bit set in CPUSET representing the processors threads created with
<span class="lineNum">     394 </span>                :    ATTR can run on.  */
<span class="lineNum">     395 </span>                : extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
<span class="lineNum">     396 </span>                :                                         size_t __cpusetsize,
<span class="lineNum">     397 </span>                :                                         cpu_set_t *__cpuset)
<span class="lineNum">     398 </span>                :      __THROW __nonnull ((1, 3));
<span class="lineNum">     399 </span>                : 
<span class="lineNum">     400 </span>                : 
<span class="lineNum">     401 </span>                : /* Initialize thread attribute *ATTR with attributes corresponding to the
<span class="lineNum">     402 </span>                :    already running thread TH.  It shall be called on uninitialized ATTR
<span class="lineNum">     403 </span>                :    and destroyed with pthread_attr_destroy when no longer needed.  */
<span class="lineNum">     404 </span>                : extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
<span class="lineNum">     405 </span>                :      __THROW __nonnull ((2));
<span class="lineNum">     406 </span>                : #endif
<span class="lineNum">     407 </span>                : 
<span class="lineNum">     408 </span>                : 
<span class="lineNum">     409 </span>                : /* Functions for scheduling control.  */
<span class="lineNum">     410 </span>                : 
<span class="lineNum">     411 </span>                : /* Set the scheduling parameters for TARGET_THREAD according to POLICY
<span class="lineNum">     412 </span>                :    and *PARAM.  */
<span class="lineNum">     413 </span>                : extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
<span class="lineNum">     414 </span>                :                                   __const struct sched_param *__param)
<span class="lineNum">     415 </span>                :      __THROW __nonnull ((3));
<span class="lineNum">     416 </span>                : 
<span class="lineNum">     417 </span>                : /* Return in *POLICY and *PARAM the scheduling parameters for TARGET_THREAD. */
<span class="lineNum">     418 </span>                : extern int pthread_getschedparam (pthread_t __target_thread,
<span class="lineNum">     419 </span>                :                                   int *__restrict __policy,
<span class="lineNum">     420 </span>                :                                   struct sched_param *__restrict __param)
<span class="lineNum">     421 </span>                :      __THROW __nonnull ((2, 3));
<span class="lineNum">     422 </span>                : 
<span class="lineNum">     423 </span>                : /* Set the scheduling priority for TARGET_THREAD.  */
<span class="lineNum">     424 </span>                : extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
<span class="lineNum">     425 </span>                :      __THROW;
<span class="lineNum">     426 </span>                : 
<span class="lineNum">     427 </span>                : 
<span class="lineNum">     428 </span>                : #ifdef __USE_UNIX98
<span class="lineNum">     429 </span>                : /* Determine level of concurrency.  */
<span class="lineNum">     430 </span>                : extern int pthread_getconcurrency (void) __THROW;
<span class="lineNum">     431 </span>                : 
<span class="lineNum">     432 </span>                : /* Set new concurrency level to LEVEL.  */
<span class="lineNum">     433 </span>                : extern int pthread_setconcurrency (int __level) __THROW;
<span class="lineNum">     434 </span>                : #endif
<span class="lineNum">     435 </span>                : 
<span class="lineNum">     436 </span>                : #ifdef __USE_GNU
<span class="lineNum">     437 </span>                : /* Yield the processor to another thread or process.
<span class="lineNum">     438 </span>                :    This function is similar to the POSIX `sched_yield' function but
<span class="lineNum">     439 </span>                :    might be differently implemented in the case of a m-on-n thread
<span class="lineNum">     440 </span>                :    implementation.  */
<span class="lineNum">     441 </span>                : extern int pthread_yield (void) __THROW;
<span class="lineNum">     442 </span>                : 
<span class="lineNum">     443 </span>                : 
<span class="lineNum">     444 </span>                : /* Limit specified thread TH to run only on the processors represented
<span class="lineNum">     445 </span>                :    in CPUSET.  */
<span class="lineNum">     446 </span>                : extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
<span class="lineNum">     447 </span>                :                                    __const cpu_set_t *__cpuset)
<span class="lineNum">     448 </span>                :      __THROW __nonnull ((3));
<span class="lineNum">     449 </span>                : 
<span class="lineNum">     450 </span>                : /* Get bit set in CPUSET representing the processors TH can run on.  */
<span class="lineNum">     451 </span>                : extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
<span class="lineNum">     452 </span>                :                                    cpu_set_t *__cpuset)
<span class="lineNum">     453 </span>                :      __THROW __nonnull ((3));
<span class="lineNum">     454 </span>                : #endif
<span class="lineNum">     455 </span>                : 
<span class="lineNum">     456 </span>                : 
<span class="lineNum">     457 </span>                : /* Functions for handling initialization.  */
<span class="lineNum">     458 </span>                : 
<span class="lineNum">     459 </span>                : /* Guarantee that the initialization function INIT_ROUTINE will be called
<span class="lineNum">     460 </span>                :    only once, even if pthread_once is executed several times with the
<span class="lineNum">     461 </span>                :    same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
<span class="lineNum">     462 </span>                :    extern variable initialized to PTHREAD_ONCE_INIT.
<span class="lineNum">     463 </span>                : 
<span class="lineNum">     464 </span>                :    The initialization functions might throw exception which is why
<span class="lineNum">     465 </span>                :    this function is not marked with __THROW.  */
<span class="lineNum">     466 </span>                : extern int pthread_once (pthread_once_t *__once_control,
<span class="lineNum">     467 </span>                :                          void (*__init_routine) (void)) __nonnull ((1, 2));
<span class="lineNum">     468 </span>                : 
<span class="lineNum">     469 </span>                : 
<span class="lineNum">     470 </span>                : /* Functions for handling cancellation.
<span class="lineNum">     471 </span>                : 
<span class="lineNum">     472 </span>                :    Note that these functions are explicitly not marked to not throw an
<span class="lineNum">     473 </span>                :    exception in C++ code.  If cancellation is implemented by unwinding
<span class="lineNum">     474 </span>                :    this is necessary to have the compiler generate the unwind information.  */
<span class="lineNum">     475 </span>                : 
<span class="lineNum">     476 </span>                : /* Set cancelability state of current thread to STATE, returning old
<span class="lineNum">     477 </span>                :    state in *OLDSTATE if OLDSTATE is not NULL.  */
<span class="lineNum">     478 </span>                : extern int pthread_setcancelstate (int __state, int *__oldstate);
<span class="lineNum">     479 </span>                : 
<span class="lineNum">     480 </span>                : /* Set cancellation state of current thread to TYPE, returning the old
<span class="lineNum">     481 </span>                :    type in *OLDTYPE if OLDTYPE is not NULL.  */
<span class="lineNum">     482 </span>                : extern int pthread_setcanceltype (int __type, int *__oldtype);
<span class="lineNum">     483 </span>                : 
<span class="lineNum">     484 </span>                : /* Cancel THREAD immediately or at the next possibility.  */
<span class="lineNum">     485 </span>                : extern int pthread_cancel (pthread_t __th);
<span class="lineNum">     486 </span>                : 
<span class="lineNum">     487 </span>                : /* Test for pending cancellation for the current thread and terminate
<span class="lineNum">     488 </span>                :    the thread as per pthread_exit(PTHREAD_CANCELED) if it has been
<span class="lineNum">     489 </span>                :    cancelled.  */
<span class="lineNum">     490 </span>                : extern void pthread_testcancel (void);
<span class="lineNum">     491 </span>                : 
<span class="lineNum">     492 </span>                : 
<span class="lineNum">     493 </span>                : /* Cancellation handling with integration into exception handling.  */
<span class="lineNum">     494 </span>                : 
<span class="lineNum">     495 </span>                : typedef struct
<span class="lineNum">     496 </span>                : {
<span class="lineNum">     497 </span>                :   struct
<span class="lineNum">     498 </span>                :   {
<span class="lineNum">     499 </span>                :     __jmp_buf __cancel_jmp_buf;
<span class="lineNum">     500 </span>                :     int __mask_was_saved;
<span class="lineNum">     501 </span>                :   } __cancel_jmp_buf[1];
<span class="lineNum">     502 </span>                :   void *__pad[4];
<span class="lineNum">     503 </span>                : } __pthread_unwind_buf_t __attribute__ ((__aligned__));
<span class="lineNum">     504 </span>                : 
<span class="lineNum">     505 </span>                : /* No special attributes by default.  */
<span class="lineNum">     506 </span>                : #ifndef __cleanup_fct_attribute
<span class="lineNum">     507 </span>                : # define __cleanup_fct_attribute
<span class="lineNum">     508 </span>                : #endif
<span class="lineNum">     509 </span>                : 
<span class="lineNum">     510 </span>                : 
<span class="lineNum">     511 </span>                : /* Structure to hold the cleanup handler information.  */
<span class="lineNum">     512 </span>                : struct __pthread_cleanup_frame
<span class="lineNum">     513 </span>                : {
<span class="lineNum">     514 </span>                :   void (*__cancel_routine) (void *);
<span class="lineNum">     515 </span>                :   void *__cancel_arg;
<span class="lineNum">     516 </span>                :   int __do_it;
<span class="lineNum">     517 </span>                :   int __cancel_type;
<span class="lineNum">     518 </span>                : };
<span class="lineNum">     519 </span>                : 
<span class="lineNum">     520 </span>                : #if defined __GNUC__ &amp;&amp; defined __EXCEPTIONS
<span class="lineNum">     521 </span>                : # ifdef __cplusplus
<span class="lineNum">     522 </span>                : /* Class to handle cancellation handler invocation.  */
<span class="lineNum">     523 </span>                : class __pthread_cleanup_class
<span class="lineNum">     524 </span>                : {
<span class="lineNum">     525 </span>                :   void (*__cancel_routine) (void *);
<span class="lineNum">     526 </span>                :   void *__cancel_arg;
<span class="lineNum">     527 </span>                :   int __do_it;
<span class="lineNum">     528 </span>                :   int __cancel_type;
<span class="lineNum">     529 </span>                : 
<span class="lineNum">     530 </span>                :  public:
<span class="lineNum">     531 </span><span class="lineNoCov">              0 :   __pthread_cleanup_class (void (*__fct) (void *), void *__arg)</span>
<span class="lineNum">     532 </span><span class="lineNoCov">              0 :     : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }</span>
<span class="lineNum">     533 </span><span class="lineNoCov">              0 :   ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }</span>
<span class="lineNum">     534 </span><span class="lineNoCov">              0 :   void __setdoit (int __newval) { __do_it = __newval; }</span>
<span class="lineNum">     535 </span><span class="lineNoCov">              0 :   void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,</span>
<span class="lineNum">     536 </span><span class="lineNoCov">              0 :                                            &amp;__cancel_type); }</span>
<span class="lineNum">     537 </span><span class="lineNoCov">              0 :   void __restore () const { pthread_setcanceltype (__cancel_type, 0); }</span>
<span class="lineNum">     538 </span>                : };
<span class="lineNum">     539 </span>                : 
<span class="lineNum">     540 </span>                : /* Install a cleanup handler: ROUTINE will be called with arguments ARG
<span class="lineNum">     541 </span>                :    when the thread is canceled or calls pthread_exit.  ROUTINE will also
<span class="lineNum">     542 </span>                :    be called with arguments ARG when the matching pthread_cleanup_pop
<span class="lineNum">     543 </span>                :    is executed with non-zero EXECUTE argument.
<span class="lineNum">     544 </span>                : 
<span class="lineNum">     545 </span>                :    pthread_cleanup_push and pthread_cleanup_pop are macros and must always
<span class="lineNum">     546 </span>                :    be used in matching pairs at the same nesting level of braces.  */
<span class="lineNum">     547 </span>                : #  define pthread_cleanup_push(routine, arg) \
<span class="lineNum">     548 </span>                :   do {                                                                        \
<span class="lineNum">     549 </span>                :     __pthread_cleanup_class __clframe (routine, arg)
<span class="lineNum">     550 </span>                : 
<span class="lineNum">     551 </span>                : /* Remove a cleanup handler installed by the matching pthread_cleanup_push.
<span class="lineNum">     552 </span>                :    If EXECUTE is non-zero, the handler function is called. */
<span class="lineNum">     553 </span>                : #  define pthread_cleanup_pop(execute) \
<span class="lineNum">     554 </span>                :     __clframe.__setdoit (execute);                                            \
<span class="lineNum">     555 </span>                :   } while (0)
<span class="lineNum">     556 </span>                : 
<span class="lineNum">     557 </span>                : #  ifdef __USE_GNU
<span class="lineNum">     558 </span>                : /* Install a cleanup handler as pthread_cleanup_push does, but also
<span class="lineNum">     559 </span>                :    saves the current cancellation type and sets it to deferred
<span class="lineNum">     560 </span>                :    cancellation.  */
<span class="lineNum">     561 </span>                : #   define pthread_cleanup_push_defer_np(routine, arg) \
<span class="lineNum">     562 </span>                :   do {                                                                        \
<span class="lineNum">     563 </span>                :     __pthread_cleanup_class __clframe (routine, arg);                         \
<span class="lineNum">     564 </span>                :     __clframe.__defer ()
<span class="lineNum">     565 </span>                : 
<span class="lineNum">     566 </span>                : /* Remove a cleanup handler as pthread_cleanup_pop does, but also
<span class="lineNum">     567 </span>                :    restores the cancellation type that was in effect when the matching
<span class="lineNum">     568 </span>                :    pthread_cleanup_push_defer was called.  */
<span class="lineNum">     569 </span>                : #   define pthread_cleanup_pop_restore_np(execute) \
<span class="lineNum">     570 </span>                :     __clframe.__restore ();                                                   \
<span class="lineNum">     571 </span>                :     __clframe.__setdoit (execute);                                            \
<span class="lineNum">     572 </span>                :   } while (0)
<span class="lineNum">     573 </span>                : #  endif
<span class="lineNum">     574 </span>                : # else
<span class="lineNum">     575 </span>                : /* Function called to call the cleanup handler.  As an extern inline
<span class="lineNum">     576 </span>                :    function the compiler is free to decide inlining the change when
<span class="lineNum">     577 </span>                :    needed or fall back on the copy which must exist somewhere
<span class="lineNum">     578 </span>                :    else.  */
<span class="lineNum">     579 </span>                : __extern_inline void
<span class="lineNum">     580 </span>                : __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
<span class="lineNum">     581 </span>                : {
<span class="lineNum">     582 </span>                :   if (__frame-&gt;__do_it)
<span class="lineNum">     583 </span>                :     __frame-&gt;__cancel_routine (__frame-&gt;__cancel_arg);
<span class="lineNum">     584 </span>                : }
<span class="lineNum">     585 </span>                : 
<span class="lineNum">     586 </span>                : /* Install a cleanup handler: ROUTINE will be called with arguments ARG
<span class="lineNum">     587 </span>                :    when the thread is canceled or calls pthread_exit.  ROUTINE will also
<span class="lineNum">     588 </span>                :    be called with arguments ARG when the matching pthread_cleanup_pop
<span class="lineNum">     589 </span>                :    is executed with non-zero EXECUTE argument.
<span class="lineNum">     590 </span>                : 
<span class="lineNum">     591 </span>                :    pthread_cleanup_push and pthread_cleanup_pop are macros and must always
<span class="lineNum">     592 </span>                :    be used in matching pairs at the same nesting level of braces.  */
<span class="lineNum">     593 </span>                : #  define pthread_cleanup_push(routine, arg) \
<span class="lineNum">     594 </span>                :   do {                                                                        \
<span class="lineNum">     595 </span>                :     struct __pthread_cleanup_frame __clframe                                  \
<span class="lineNum">     596 </span>                :       __attribute__ ((__cleanup__ (__pthread_cleanup_routine)))               \
<span class="lineNum">     597 </span>                :       = { .__cancel_routine = (routine), .__cancel_arg = (arg),               \
<span class="lineNum">     598 </span>                :           .__do_it = 1 };
<span class="lineNum">     599 </span>                : 
<span class="lineNum">     600 </span>                : /* Remove a cleanup handler installed by the matching pthread_cleanup_push.
<span class="lineNum">     601 </span>                :    If EXECUTE is non-zero, the handler function is called. */
<span class="lineNum">     602 </span>                : #  define pthread_cleanup_pop(execute) \
<span class="lineNum">     603 </span>                :     __clframe.__do_it = (execute);                                            \
<span class="lineNum">     604 </span>                :   } while (0)
<span class="lineNum">     605 </span>                : 
<span class="lineNum">     606 </span>                : #  ifdef __USE_GNU
<span class="lineNum">     607 </span>                : /* Install a cleanup handler as pthread_cleanup_push does, but also
<span class="lineNum">     608 </span>                :    saves the current cancellation type and sets it to deferred
<span class="lineNum">     609 </span>                :    cancellation.  */
<span class="lineNum">     610 </span>                : #   define pthread_cleanup_push_defer_np(routine, arg) \
<span class="lineNum">     611 </span>                :   do {                                                                        \
<span class="lineNum">     612 </span>                :     struct __pthread_cleanup_frame __clframe                                  \
<span class="lineNum">     613 </span>                :       __attribute__ ((__cleanup__ (__pthread_cleanup_routine)))               \
<span class="lineNum">     614 </span>                :       = { .__cancel_routine = (routine), .__cancel_arg = (arg),               \
<span class="lineNum">     615 </span>                :           .__do_it = 1 };                                                     \
<span class="lineNum">     616 </span>                :     (void) pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,                    \
<span class="lineNum">     617 </span>                :                                   &amp;__clframe.__cancel_type)
<span class="lineNum">     618 </span>                : 
<span class="lineNum">     619 </span>                : /* Remove a cleanup handler as pthread_cleanup_pop does, but also
<span class="lineNum">     620 </span>                :    restores the cancellation type that was in effect when the matching
<span class="lineNum">     621 </span>                :    pthread_cleanup_push_defer was called.  */
<span class="lineNum">     622 </span>                : #   define pthread_cleanup_pop_restore_np(execute) \
<span class="lineNum">     623 </span>                :     (void) pthread_setcanceltype (__clframe.__cancel_type, NULL);             \
<span class="lineNum">     624 </span>                :     __clframe.__do_it = (execute);                                            \
<span class="lineNum">     625 </span>                :   } while (0)
<span class="lineNum">     626 </span>                : #  endif
<span class="lineNum">     627 </span>                : # endif
<span class="lineNum">     628 </span>                : #else
<span class="lineNum">     629 </span>                : /* Install a cleanup handler: ROUTINE will be called with arguments ARG
<span class="lineNum">     630 </span>                :    when the thread is canceled or calls pthread_exit.  ROUTINE will also
<span class="lineNum">     631 </span>                :    be called with arguments ARG when the matching pthread_cleanup_pop
<span class="lineNum">     632 </span>                :    is executed with non-zero EXECUTE argument.
<span class="lineNum">     633 </span>                : 
<span class="lineNum">     634 </span>                :    pthread_cleanup_push and pthread_cleanup_pop are macros and must always
<span class="lineNum">     635 </span>                :    be used in matching pairs at the same nesting level of braces.  */
<span class="lineNum">     636 </span>                : # define pthread_cleanup_push(routine, arg) \
<span class="lineNum">     637 </span>                :   do {                                                                        \
<span class="lineNum">     638 </span>                :     __pthread_unwind_buf_t __cancel_buf;                                      \
<span class="lineNum">     639 </span>                :     void (*__cancel_routine) (void *) = (routine);                            \
<span class="lineNum">     640 </span>                :     void *__cancel_arg = (arg);                                               \
<span class="lineNum">     641 </span>                :     int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *)       \
<span class="lineNum">     642 </span>                :                                       __cancel_buf.__cancel_jmp_buf, 0);      \
<span class="lineNum">     643 </span>                :     if (__builtin_expect (not_first_call, 0))                                 \
<span class="lineNum">     644 </span>                :       {                                                                       \
<span class="lineNum">     645 </span>                :         __cancel_routine (__cancel_arg);                                      \
<span class="lineNum">     646 </span>                :         __pthread_unwind_next (&amp;__cancel_buf);                                    \
<span class="lineNum">     647 </span>                :         /* NOTREACHED */                                                      \
<span class="lineNum">     648 </span>                :       }                                                                       \
<span class="lineNum">     649 </span>                :                                                                               \
<span class="lineNum">     650 </span>                :     __pthread_register_cancel (&amp;__cancel_buf);                                    \
<span class="lineNum">     651 </span>                :     do {
<span class="lineNum">     652 </span>                : extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf)
<span class="lineNum">     653 </span>                :      __cleanup_fct_attribute;
<span class="lineNum">     654 </span>                : 
<span class="lineNum">     655 </span>                : /* Remove a cleanup handler installed by the matching pthread_cleanup_push.
<span class="lineNum">     656 </span>                :    If EXECUTE is non-zero, the handler function is called. */
<span class="lineNum">     657 </span>                : # define pthread_cleanup_pop(execute) \
<span class="lineNum">     658 </span>                :       do { } while (0);/* Empty to allow label before pthread_cleanup_pop.  */\
<span class="lineNum">     659 </span>                :     } while (0);                                                              \
<span class="lineNum">     660 </span>                :     __pthread_unregister_cancel (&amp;__cancel_buf);                          \
<span class="lineNum">     661 </span>                :     if (execute)                                                              \
<span class="lineNum">     662 </span>                :       __cancel_routine (__cancel_arg);                                        \
<span class="lineNum">     663 </span>                :   } while (0)
<span class="lineNum">     664 </span>                : extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf)
<span class="lineNum">     665 </span>                :   __cleanup_fct_attribute;
<span class="lineNum">     666 </span>                : 
<span class="lineNum">     667 </span>                : # ifdef __USE_GNU
<span class="lineNum">     668 </span>                : /* Install a cleanup handler as pthread_cleanup_push does, but also
<span class="lineNum">     669 </span>                :    saves the current cancellation type and sets it to deferred
<span class="lineNum">     670 </span>                :    cancellation.  */
<span class="lineNum">     671 </span>                : #  define pthread_cleanup_push_defer_np(routine, arg) \
<span class="lineNum">     672 </span>                :   do {                                                                        \
<span class="lineNum">     673 </span>                :     __pthread_unwind_buf_t __cancel_buf;                                      \
<span class="lineNum">     674 </span>                :     void (*__cancel_routine) (void *) = (routine);                            \
<span class="lineNum">     675 </span>                :     void *__cancel_arg = (arg);                                               \
<span class="lineNum">     676 </span>                :     int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *)       \
<span class="lineNum">     677 </span>                :                                       __cancel_buf.__cancel_jmp_buf, 0);      \
<span class="lineNum">     678 </span>                :     if (__builtin_expect (not_first_call, 0))                                 \
<span class="lineNum">     679 </span>                :       {                                                                       \
<span class="lineNum">     680 </span>                :         __cancel_routine (__cancel_arg);                                      \
<span class="lineNum">     681 </span>                :         __pthread_unwind_next (&amp;__cancel_buf);                                    \
<span class="lineNum">     682 </span>                :         /* NOTREACHED */                                                      \
<span class="lineNum">     683 </span>                :       }                                                                       \
<span class="lineNum">     684 </span>                :                                                                               \
<span class="lineNum">     685 </span>                :     __pthread_register_cancel_defer (&amp;__cancel_buf);                              \
<span class="lineNum">     686 </span>                :     do {
<span class="lineNum">     687 </span>                : extern void __pthread_register_cancel_defer (__pthread_unwind_buf_t *__buf)
<span class="lineNum">     688 </span>                :      __cleanup_fct_attribute;
<span class="lineNum">     689 </span>                : 
<span class="lineNum">     690 </span>                : /* Remove a cleanup handler as pthread_cleanup_pop does, but also
<span class="lineNum">     691 </span>                :    restores the cancellation type that was in effect when the matching
<span class="lineNum">     692 </span>                :    pthread_cleanup_push_defer was called.  */
<span class="lineNum">     693 </span>                : #  define pthread_cleanup_pop_restore_np(execute) \
<span class="lineNum">     694 </span>                :       do { } while (0);/* Empty to allow label before pthread_cleanup_pop.  */\
<span class="lineNum">     695 </span>                :     } while (0);                                                              \
<span class="lineNum">     696 </span>                :     __pthread_unregister_cancel_restore (&amp;__cancel_buf);                  \
<span class="lineNum">     697 </span>                :     if (execute)                                                              \
<span class="lineNum">     698 </span>                :       __cancel_routine (__cancel_arg);                                        \
<span class="lineNum">     699 </span>                :   } while (0)
<span class="lineNum">     700 </span>                : extern void __pthread_unregister_cancel_restore (__pthread_unwind_buf_t *__buf)
<span class="lineNum">     701 </span>                :   __cleanup_fct_attribute;
<span class="lineNum">     702 </span>                : # endif
<span class="lineNum">     703 </span>                : 
<span class="lineNum">     704 </span>                : /* Internal interface to initiate cleanup.  */
<span class="lineNum">     705 </span>                : extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf)
<span class="lineNum">     706 </span>                :      __cleanup_fct_attribute __attribute__ ((__noreturn__))
<span class="lineNum">     707 </span>                : # ifndef SHARED
<span class="lineNum">     708 </span>                :      __attribute__ ((__weak__))
<span class="lineNum">     709 </span>                : # endif
<span class="lineNum">     710 </span>                :      ;
<span class="lineNum">     711 </span>                : #endif
<span class="lineNum">     712 </span>                : 
<span class="lineNum">     713 </span>                : /* Function used in the macros.  */
<span class="lineNum">     714 </span>                : struct __jmp_buf_tag;
<span class="lineNum">     715 </span>                : extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROW;
<span class="lineNum">     716 </span>                : 
<span class="lineNum">     717 </span>                : 
<span class="lineNum">     718 </span>                : /* Mutex handling.  */
<span class="lineNum">     719 </span>                : 
<span class="lineNum">     720 </span>                : /* Initialize a mutex.  */
<span class="lineNum">     721 </span>                : extern int pthread_mutex_init (pthread_mutex_t *__mutex,
<span class="lineNum">     722 </span>                :                                __const pthread_mutexattr_t *__mutexattr)
<span class="lineNum">     723 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     724 </span>                : 
<span class="lineNum">     725 </span>                : /* Destroy a mutex.  */
<span class="lineNum">     726 </span>                : extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
<span class="lineNum">     727 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     728 </span>                : 
<span class="lineNum">     729 </span>                : /* Try locking a mutex.  */
<span class="lineNum">     730 </span>                : extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
<span class="lineNum">     731 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     732 </span>                : 
<span class="lineNum">     733 </span>                : /* Lock a mutex.  */
<span class="lineNum">     734 </span>                : extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
<span class="lineNum">     735 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     736 </span>                : 
<span class="lineNum">     737 </span>                : #ifdef __USE_XOPEN2K
<span class="lineNum">     738 </span>                : /* Wait until lock becomes available, or specified time passes. */
<span class="lineNum">     739 </span>                : extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
<span class="lineNum">     740 </span>                :                                     __const struct timespec *__restrict
<span class="lineNum">     741 </span>                :                                     __abstime) __THROW __nonnull ((1, 2));
<span class="lineNum">     742 </span>                : #endif
<span class="lineNum">     743 </span>                : 
<span class="lineNum">     744 </span>                : /* Unlock a mutex.  */
<span class="lineNum">     745 </span>                : extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
<span class="lineNum">     746 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     747 </span>                : 
<span class="lineNum">     748 </span>                : 
<span class="lineNum">     749 </span>                : #ifdef __USE_UNIX98
<span class="lineNum">     750 </span>                : /* Get the priority ceiling of MUTEX.  */
<span class="lineNum">     751 </span>                : extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
<span class="lineNum">     752 </span>                :                                          __restrict __mutex,
<span class="lineNum">     753 </span>                :                                          int *__restrict __prioceiling)
<span class="lineNum">     754 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     755 </span>                : 
<span class="lineNum">     756 </span>                : /* Set the priority ceiling of MUTEX to PRIOCEILING, return old
<span class="lineNum">     757 </span>                :    priority ceiling value in *OLD_CEILING.  */
<span class="lineNum">     758 </span>                : extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
<span class="lineNum">     759 </span>                :                                          int __prioceiling,
<span class="lineNum">     760 </span>                :                                          int *__restrict __old_ceiling)
<span class="lineNum">     761 </span>                :      __THROW __nonnull ((1, 3));
<span class="lineNum">     762 </span>                : #endif
<span class="lineNum">     763 </span>                : 
<span class="lineNum">     764 </span>                : 
<span class="lineNum">     765 </span>                : #ifdef __USE_GNU
<span class="lineNum">     766 </span>                : /* Declare the state protected by MUTEX as consistent.  */
<span class="lineNum">     767 </span>                : extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
<span class="lineNum">     768 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     769 </span>                : #endif
<span class="lineNum">     770 </span>                : 
<span class="lineNum">     771 </span>                : 
<span class="lineNum">     772 </span>                : /* Functions for handling mutex attributes.  */
<span class="lineNum">     773 </span>                : 
<span class="lineNum">     774 </span>                : /* Initialize mutex attribute object ATTR with default attributes
<span class="lineNum">     775 </span>                :    (kind is PTHREAD_MUTEX_TIMED_NP).  */
<span class="lineNum">     776 </span>                : extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
<span class="lineNum">     777 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     778 </span>                : 
<span class="lineNum">     779 </span>                : /* Destroy mutex attribute object ATTR.  */
<span class="lineNum">     780 </span>                : extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
<span class="lineNum">     781 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     782 </span>                : 
<span class="lineNum">     783 </span>                : /* Get the process-shared flag of the mutex attribute ATTR.  */
<span class="lineNum">     784 </span>                : extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
<span class="lineNum">     785 </span>                :                                          __restrict __attr,
<span class="lineNum">     786 </span>                :                                          int *__restrict __pshared)
<span class="lineNum">     787 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     788 </span>                : 
<span class="lineNum">     789 </span>                : /* Set the process-shared flag of the mutex attribute ATTR.  */
<span class="lineNum">     790 </span>                : extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
<span class="lineNum">     791 </span>                :                                          int __pshared)
<span class="lineNum">     792 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     793 </span>                : 
<span class="lineNum">     794 </span>                : #ifdef __USE_UNIX98
<span class="lineNum">     795 </span>                : /* Return in *KIND the mutex kind attribute in *ATTR.  */
<span class="lineNum">     796 </span>                : extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
<span class="lineNum">     797 </span>                :                                       __attr, int *__restrict __kind)
<span class="lineNum">     798 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     799 </span>                : 
<span class="lineNum">     800 </span>                : /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL,
<span class="lineNum">     801 </span>                :    PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or
<span class="lineNum">     802 </span>                :    PTHREAD_MUTEX_DEFAULT).  */
<span class="lineNum">     803 </span>                : extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
<span class="lineNum">     804 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     805 </span>                : 
<span class="lineNum">     806 </span>                : /* Return in *PROTOCOL the mutex protocol attribute in *ATTR.  */
<span class="lineNum">     807 </span>                : extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
<span class="lineNum">     808 </span>                :                                           __restrict __attr,
<span class="lineNum">     809 </span>                :                                           int *__restrict __protocol)
<span class="lineNum">     810 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     811 </span>                : 
<span class="lineNum">     812 </span>                : /* Set the mutex protocol attribute in *ATTR to PROTOCOL (either
<span class="lineNum">     813 </span>                :    PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT).  */
<span class="lineNum">     814 </span>                : extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
<span class="lineNum">     815 </span>                :                                           int __protocol)
<span class="lineNum">     816 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     817 </span>                : 
<span class="lineNum">     818 </span>                : /* Return in *PRIOCEILING the mutex prioceiling attribute in *ATTR.  */
<span class="lineNum">     819 </span>                : extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
<span class="lineNum">     820 </span>                :                                              __restrict __attr,
<span class="lineNum">     821 </span>                :                                              int *__restrict __prioceiling)
<span class="lineNum">     822 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     823 </span>                : 
<span class="lineNum">     824 </span>                : /* Set the mutex prioceiling attribute in *ATTR to PRIOCEILING.  */
<span class="lineNum">     825 </span>                : extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
<span class="lineNum">     826 </span>                :                                              int __prioceiling)
<span class="lineNum">     827 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     828 </span>                : #endif
<span class="lineNum">     829 </span>                : 
<span class="lineNum">     830 </span>                : #ifdef __USE_GNU
<span class="lineNum">     831 </span>                : /* Get the robustness flag of the mutex attribute ATTR.  */
<span class="lineNum">     832 </span>                : extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
<span class="lineNum">     833 </span>                :                                            int *__robustness)
<span class="lineNum">     834 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     835 </span>                : 
<span class="lineNum">     836 </span>                : /* Set the robustness flag of the mutex attribute ATTR.  */
<span class="lineNum">     837 </span>                : extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
<span class="lineNum">     838 </span>                :                                            int __robustness)
<span class="lineNum">     839 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     840 </span>                : #endif
<span class="lineNum">     841 </span>                : 
<span class="lineNum">     842 </span>                : 
<span class="lineNum">     843 </span>                : #if defined __USE_UNIX98 || defined __USE_XOPEN2K
<span class="lineNum">     844 </span>                : /* Functions for handling read-write locks.  */
<span class="lineNum">     845 </span>                : 
<span class="lineNum">     846 </span>                : /* Initialize read-write lock RWLOCK using attributes ATTR, or use
<span class="lineNum">     847 </span>                :    the default values if later is NULL.  */
<span class="lineNum">     848 </span>                : extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
<span class="lineNum">     849 </span>                :                                 __const pthread_rwlockattr_t *__restrict
<span class="lineNum">     850 </span>                :                                 __attr) __THROW __nonnull ((1));
<span class="lineNum">     851 </span>                : 
<span class="lineNum">     852 </span>                : /* Destroy read-write lock RWLOCK.  */
<span class="lineNum">     853 </span>                : extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
<span class="lineNum">     854 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     855 </span>                : 
<span class="lineNum">     856 </span>                : /* Acquire read lock for RWLOCK.  */
<span class="lineNum">     857 </span>                : extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
<span class="lineNum">     858 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     859 </span>                : 
<span class="lineNum">     860 </span>                : /* Try to acquire read lock for RWLOCK.  */
<span class="lineNum">     861 </span>                : extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
<span class="lineNum">     862 </span>                :   __THROW __nonnull ((1));
<span class="lineNum">     863 </span>                : 
<span class="lineNum">     864 </span>                : # ifdef __USE_XOPEN2K
<span class="lineNum">     865 </span>                : /* Try to acquire read lock for RWLOCK or return after specfied time.  */
<span class="lineNum">     866 </span>                : extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
<span class="lineNum">     867 </span>                :                                        __const struct timespec *__restrict
<span class="lineNum">     868 </span>                :                                        __abstime) __THROW __nonnull ((1, 2));
<span class="lineNum">     869 </span>                : # endif
<span class="lineNum">     870 </span>                : 
<span class="lineNum">     871 </span>                : /* Acquire write lock for RWLOCK.  */
<span class="lineNum">     872 </span>                : extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
<span class="lineNum">     873 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     874 </span>                : 
<span class="lineNum">     875 </span>                : /* Try to acquire write lock for RWLOCK.  */
<span class="lineNum">     876 </span>                : extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
<span class="lineNum">     877 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     878 </span>                : 
<span class="lineNum">     879 </span>                : # ifdef __USE_XOPEN2K
<span class="lineNum">     880 </span>                : /* Try to acquire write lock for RWLOCK or return after specfied time.  */
<span class="lineNum">     881 </span>                : extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
<span class="lineNum">     882 </span>                :                                        __const struct timespec *__restrict
<span class="lineNum">     883 </span>                :                                        __abstime) __THROW __nonnull ((1, 2));
<span class="lineNum">     884 </span>                : # endif
<span class="lineNum">     885 </span>                : 
<span class="lineNum">     886 </span>                : /* Unlock RWLOCK.  */
<span class="lineNum">     887 </span>                : extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
<span class="lineNum">     888 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     889 </span>                : 
<span class="lineNum">     890 </span>                : 
<span class="lineNum">     891 </span>                : /* Functions for handling read-write lock attributes.  */
<span class="lineNum">     892 </span>                : 
<span class="lineNum">     893 </span>                : /* Initialize attribute object ATTR with default values.  */
<span class="lineNum">     894 </span>                : extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
<span class="lineNum">     895 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     896 </span>                : 
<span class="lineNum">     897 </span>                : /* Destroy attribute object ATTR.  */
<span class="lineNum">     898 </span>                : extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
<span class="lineNum">     899 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     900 </span>                : 
<span class="lineNum">     901 </span>                : /* Return current setting of process-shared attribute of ATTR in PSHARED.  */
<span class="lineNum">     902 </span>                : extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
<span class="lineNum">     903 </span>                :                                           __restrict __attr,
<span class="lineNum">     904 </span>                :                                           int *__restrict __pshared)
<span class="lineNum">     905 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     906 </span>                : 
<span class="lineNum">     907 </span>                : /* Set process-shared attribute of ATTR to PSHARED.  */
<span class="lineNum">     908 </span>                : extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
<span class="lineNum">     909 </span>                :                                           int __pshared)
<span class="lineNum">     910 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     911 </span>                : 
<span class="lineNum">     912 </span>                : /* Return current setting of reader/writer preference.  */
<span class="lineNum">     913 </span>                : extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
<span class="lineNum">     914 </span>                :                                           __restrict __attr,
<span class="lineNum">     915 </span>                :                                           int *__restrict __pref)
<span class="lineNum">     916 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     917 </span>                : 
<span class="lineNum">     918 </span>                : /* Set reader/write preference.  */
<span class="lineNum">     919 </span>                : extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
<span class="lineNum">     920 </span>                :                                           int __pref) __THROW __nonnull ((1));
<span class="lineNum">     921 </span>                : #endif
<span class="lineNum">     922 </span>                : 
<span class="lineNum">     923 </span>                : 
<span class="lineNum">     924 </span>                : /* Functions for handling conditional variables.  */
<span class="lineNum">     925 </span>                : 
<span class="lineNum">     926 </span>                : /* Initialize condition variable COND using attributes ATTR, or use
<span class="lineNum">     927 </span>                :    the default values if later is NULL.  */
<span class="lineNum">     928 </span>                : extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
<span class="lineNum">     929 </span>                :                               __const pthread_condattr_t *__restrict
<span class="lineNum">     930 </span>                :                               __cond_attr) __THROW __nonnull ((1));
<span class="lineNum">     931 </span>                : 
<span class="lineNum">     932 </span>                : /* Destroy condition variable COND.  */
<span class="lineNum">     933 </span>                : extern int pthread_cond_destroy (pthread_cond_t *__cond)
<span class="lineNum">     934 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     935 </span>                : 
<span class="lineNum">     936 </span>                : /* Wake up one thread waiting for condition variable COND.  */
<span class="lineNum">     937 </span>                : extern int pthread_cond_signal (pthread_cond_t *__cond)
<span class="lineNum">     938 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     939 </span>                : 
<span class="lineNum">     940 </span>                : /* Wake up all threads waiting for condition variables COND.  */
<span class="lineNum">     941 </span>                : extern int pthread_cond_broadcast (pthread_cond_t *__cond)
<span class="lineNum">     942 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     943 </span>                : 
<span class="lineNum">     944 </span>                : /* Wait for condition variable COND to be signaled or broadcast.
<span class="lineNum">     945 </span>                :    MUTEX is assumed to be locked before.
<span class="lineNum">     946 </span>                : 
<span class="lineNum">     947 </span>                :    This function is a cancellation point and therefore not marked with
<span class="lineNum">     948 </span>                :    __THROW.  */
<span class="lineNum">     949 </span>                : extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
<span class="lineNum">     950 </span>                :                               pthread_mutex_t *__restrict __mutex)
<span class="lineNum">     951 </span>                :      __nonnull ((1, 2));
<span class="lineNum">     952 </span>                : 
<span class="lineNum">     953 </span>                : /* Wait for condition variable COND to be signaled or broadcast until
<span class="lineNum">     954 </span>                :    ABSTIME.  MUTEX is assumed to be locked before.  ABSTIME is an
<span class="lineNum">     955 </span>                :    absolute time specification; zero is the beginning of the epoch
<span class="lineNum">     956 </span>                :    (00:00:00 GMT, January 1, 1970).
<span class="lineNum">     957 </span>                : 
<span class="lineNum">     958 </span>                :    This function is a cancellation point and therefore not marked with
<span class="lineNum">     959 </span>                :    __THROW.  */
<span class="lineNum">     960 </span>                : extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
<span class="lineNum">     961 </span>                :                                    pthread_mutex_t *__restrict __mutex,
<span class="lineNum">     962 </span>                :                                    __const struct timespec *__restrict
<span class="lineNum">     963 </span>                :                                    __abstime) __nonnull ((1, 2, 3));
<span class="lineNum">     964 </span>                : 
<span class="lineNum">     965 </span>                : /* Functions for handling condition variable attributes.  */
<span class="lineNum">     966 </span>                : 
<span class="lineNum">     967 </span>                : /* Initialize condition variable attribute ATTR.  */
<span class="lineNum">     968 </span>                : extern int pthread_condattr_init (pthread_condattr_t *__attr)
<span class="lineNum">     969 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     970 </span>                : 
<span class="lineNum">     971 </span>                : /* Destroy condition variable attribute ATTR.  */
<span class="lineNum">     972 </span>                : extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
<span class="lineNum">     973 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     974 </span>                : 
<span class="lineNum">     975 </span>                : /* Get the process-shared flag of the condition variable attribute ATTR.  */
<span class="lineNum">     976 </span>                : extern int pthread_condattr_getpshared (__const pthread_condattr_t *
<span class="lineNum">     977 </span>                :                                         __restrict __attr,
<span class="lineNum">     978 </span>                :                                         int *__restrict __pshared)
<span class="lineNum">     979 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     980 </span>                : 
<span class="lineNum">     981 </span>                : /* Set the process-shared flag of the condition variable attribute ATTR.  */
<span class="lineNum">     982 </span>                : extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
<span class="lineNum">     983 </span>                :                                         int __pshared) __THROW __nonnull ((1));
<span class="lineNum">     984 </span>                : 
<span class="lineNum">     985 </span>                : #ifdef __USE_XOPEN2K
<span class="lineNum">     986 </span>                : /* Get the clock selected for the conditon variable attribute ATTR.  */
<span class="lineNum">     987 </span>                : extern int pthread_condattr_getclock (__const pthread_condattr_t *
<span class="lineNum">     988 </span>                :                                       __restrict __attr,
<span class="lineNum">     989 </span>                :                                       __clockid_t *__restrict __clock_id)
<span class="lineNum">     990 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">     991 </span>                : 
<span class="lineNum">     992 </span>                : /* Set the clock selected for the conditon variable attribute ATTR.  */
<span class="lineNum">     993 </span>                : extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
<span class="lineNum">     994 </span>                :                                       __clockid_t __clock_id)
<span class="lineNum">     995 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">     996 </span>                : #endif
<span class="lineNum">     997 </span>                : 
<span class="lineNum">     998 </span>                : 
<span class="lineNum">     999 </span>                : #ifdef __USE_XOPEN2K
<span class="lineNum">    1000 </span>                : /* Functions to handle spinlocks.  */
<span class="lineNum">    1001 </span>                : 
<span class="lineNum">    1002 </span>                : /* Initialize the spinlock LOCK.  If PSHARED is nonzero the spinlock can
<span class="lineNum">    1003 </span>                :    be shared between different processes.  */
<span class="lineNum">    1004 </span>                : extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
<span class="lineNum">    1005 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1006 </span>                : 
<span class="lineNum">    1007 </span>                : /* Destroy the spinlock LOCK.  */
<span class="lineNum">    1008 </span>                : extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
<span class="lineNum">    1009 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1010 </span>                : 
<span class="lineNum">    1011 </span>                : /* Wait until spinlock LOCK is retrieved.  */
<span class="lineNum">    1012 </span>                : extern int pthread_spin_lock (pthread_spinlock_t *__lock)
<span class="lineNum">    1013 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1014 </span>                : 
<span class="lineNum">    1015 </span>                : /* Try to lock spinlock LOCK.  */
<span class="lineNum">    1016 </span>                : extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
<span class="lineNum">    1017 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1018 </span>                : 
<span class="lineNum">    1019 </span>                : /* Release spinlock LOCK.  */
<span class="lineNum">    1020 </span>                : extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
<span class="lineNum">    1021 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1022 </span>                : 
<span class="lineNum">    1023 </span>                : 
<span class="lineNum">    1024 </span>                : /* Functions to handle barriers.  */
<span class="lineNum">    1025 </span>                : 
<span class="lineNum">    1026 </span>                : /* Initialize BARRIER with the attributes in ATTR.  The barrier is
<span class="lineNum">    1027 </span>                :    opened when COUNT waiters arrived.  */
<span class="lineNum">    1028 </span>                : extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
<span class="lineNum">    1029 </span>                :                                  __const pthread_barrierattr_t *__restrict
<span class="lineNum">    1030 </span>                :                                  __attr, unsigned int __count)
<span class="lineNum">    1031 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1032 </span>                : 
<span class="lineNum">    1033 </span>                : /* Destroy a previously dynamically initialized barrier BARRIER.  */
<span class="lineNum">    1034 </span>                : extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
<span class="lineNum">    1035 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1036 </span>                : 
<span class="lineNum">    1037 </span>                : /* Wait on barrier BARRIER.  */
<span class="lineNum">    1038 </span>                : extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
<span class="lineNum">    1039 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1040 </span>                : 
<span class="lineNum">    1041 </span>                : 
<span class="lineNum">    1042 </span>                : /* Initialize barrier attribute ATTR.  */
<span class="lineNum">    1043 </span>                : extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
<span class="lineNum">    1044 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1045 </span>                : 
<span class="lineNum">    1046 </span>                : /* Destroy previously dynamically initialized barrier attribute ATTR.  */
<span class="lineNum">    1047 </span>                : extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
<span class="lineNum">    1048 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1049 </span>                : 
<span class="lineNum">    1050 </span>                : /* Get the process-shared flag of the barrier attribute ATTR.  */
<span class="lineNum">    1051 </span>                : extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
<span class="lineNum">    1052 </span>                :                                            __restrict __attr,
<span class="lineNum">    1053 </span>                :                                            int *__restrict __pshared)
<span class="lineNum">    1054 </span>                :      __THROW __nonnull ((1, 2));
<span class="lineNum">    1055 </span>                : 
<span class="lineNum">    1056 </span>                : /* Set the process-shared flag of the barrier attribute ATTR.  */
<span class="lineNum">    1057 </span>                : extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
<span class="lineNum">    1058 </span>                :                                            int __pshared)
<span class="lineNum">    1059 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1060 </span>                : #endif
<span class="lineNum">    1061 </span>                : 
<span class="lineNum">    1062 </span>                : 
<span class="lineNum">    1063 </span>                : /* Functions for handling thread-specific data.  */
<span class="lineNum">    1064 </span>                : 
<span class="lineNum">    1065 </span>                : /* Create a key value identifying a location in the thread-specific
<span class="lineNum">    1066 </span>                :    data area.  Each thread maintains a distinct thread-specific data
<span class="lineNum">    1067 </span>                :    area.  DESTR_FUNCTION, if non-NULL, is called with the value
<span class="lineNum">    1068 </span>                :    associated to that key when the key is destroyed.
<span class="lineNum">    1069 </span>                :    DESTR_FUNCTION is not called if the value associated is NULL when
<span class="lineNum">    1070 </span>                :    the key is destroyed.  */
<span class="lineNum">    1071 </span>                : extern int pthread_key_create (pthread_key_t *__key,
<span class="lineNum">    1072 </span>                :                                void (*__destr_function) (void *))
<span class="lineNum">    1073 </span>                :      __THROW __nonnull ((1));
<span class="lineNum">    1074 </span>                : 
<span class="lineNum">    1075 </span>                : /* Destroy KEY.  */
<span class="lineNum">    1076 </span>                : extern int pthread_key_delete (pthread_key_t __key) __THROW;
<span class="lineNum">    1077 </span>                : 
<span class="lineNum">    1078 </span>                : /* Return current value of the thread-specific data slot identified by KEY.  */
<span class="lineNum">    1079 </span>                : extern void *pthread_getspecific (pthread_key_t __key) __THROW;
<span class="lineNum">    1080 </span>                : 
<span class="lineNum">    1081 </span>                : /* Store POINTER in the thread-specific data slot identified by KEY. */
<span class="lineNum">    1082 </span>                : extern int pthread_setspecific (pthread_key_t __key,
<span class="lineNum">    1083 </span>                :                                 __const void *__pointer) __THROW ;
<span class="lineNum">    1084 </span>                : 
<span class="lineNum">    1085 </span>                : 
<span class="lineNum">    1086 </span>                : #ifdef __USE_XOPEN2K
<span class="lineNum">    1087 </span>                : /* Get ID of CPU-time clock for thread THREAD_ID.  */
<span class="lineNum">    1088 </span>                : extern int pthread_getcpuclockid (pthread_t __thread_id,
<span class="lineNum">    1089 </span>                :                                   __clockid_t *__clock_id)
<span class="lineNum">    1090 </span>                :      __THROW __nonnull ((2));
<span class="lineNum">    1091 </span>                : #endif
<span class="lineNum">    1092 </span>                : 
<span class="lineNum">    1093 </span>                : 
<span class="lineNum">    1094 </span>                : /* Install handlers to be called when a new process is created with FORK.
<span class="lineNum">    1095 </span>                :    The PREPARE handler is called in the parent process just before performing
<span class="lineNum">    1096 </span>                :    FORK. The PARENT handler is called in the parent process just after FORK.
<span class="lineNum">    1097 </span>                :    The CHILD handler is called in the child process.  Each of the three
<span class="lineNum">    1098 </span>                :    handlers can be NULL, meaning that no handler needs to be called at that
<span class="lineNum">    1099 </span>                :    point.
<span class="lineNum">    1100 </span>                :    PTHREAD_ATFORK can be called several times, in which case the PREPARE
<span class="lineNum">    1101 </span>                :    handlers are called in LIFO order (last added with PTHREAD_ATFORK,
<span class="lineNum">    1102 </span>                :    first called before FORK), and the PARENT and CHILD handlers are called
<span class="lineNum">    1103 </span>                :    in FIFO (first added, first called).  */
<span class="lineNum">    1104 </span>                : 
<span class="lineNum">    1105 </span>                : extern int pthread_atfork (void (*__prepare) (void),
<span class="lineNum">    1106 </span>                :                            void (*__parent) (void),
<span class="lineNum">    1107 </span>                :                            void (*__child) (void)) __THROW;
<span class="lineNum">    1108 </span>                : 
<span class="lineNum">    1109 </span>                : 
<span class="lineNum">    1110 </span>                : #ifdef __USE_EXTERN_INLINES
<span class="lineNum">    1111 </span>                : /* Optimizations.  */
<span class="lineNum">    1112 </span>                : __extern_inline int
<span class="lineNum">    1113 </span><span class="lineNoCov">              0 : __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))</span>
<span class="lineNum">    1114 </span>                : {
<span class="lineNum">    1115 </span><span class="lineNoCov">              0 :   return __thread1 == __thread2;</span>
<span class="lineNum">    1116 </span>                : }
<span class="lineNum">    1117 </span>                : #endif
<span class="lineNum">    1118 </span>                : 
<span class="lineNum">    1119 </span>                : __END_DECLS
<span class="lineNum">    1120 </span>                : 
<span class="lineNum">    1121 </span>                : #endif  /* pthread.h */
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
